/**
	License:		Artistic license 2.0 (see license.txt, also available online at http://www.perlfoundation.org/artistic_license_2_0)
	Authors:		OrbitalLab (http://www.orbitallab.ru/moonglide/), 2007-2009

	File:			EngRawData.d
	Description:	raw primitive data for 1 pass rendering - vertex+normal+index+colour+texCoord arrays
	Date:			21.9.2008 by Digited
*/
module moonglide.core.engobjects.EngRawData;

import
	moonglide.core.engobjects.EngObject;

struct SRawData
{
	Vector3f[]	vertex;
	Vector3f[]	normal;
	uint[]		index;
	Vector4f[]	colour;
	Vector2f[]	texCoord;

	void opAddAssign( SRawData rdata )
	{
		vertex ~= rdata.vertex;
		index ~= rdata.index;
		colour ~= rdata.colour;
		texCoord ~= rdata.texCoord;
	}

	void clear()
	{
		vertex.length = 0;
		index.length = 0;
		colour.length = 0;
		texCoord.length = 0;
	}
}

//=============================================================
/// CEngRawData - raw primitive data for 1 pass rendering
//=============================================================
class CEngRawData : public CEngObject
{
	public:
		SRawData data;

//		void OnRender() // overload this to do prerendering stuff and prepare data
//		{
//			// Do something just before rendering. Called from SceneManager on scenegraph pass
//		}

		this( char[] id )
		{
			super( id );
		}

		~this()
		{
			data.clear;
		}
}
